//
//  HttpBaseTool.h
//  Pods
//
//  Created by iOS on 2017/3/24.
//
//

#import <Foundation/Foundation.h>
typedef enum request_type {
    POST_REQUEST,
    GET_REQUEST
}request_type;

@interface HttpBaseTool : NSObject

/**
 *  发送一个GET请求
 *
 *  @param url     请求路径
 *  @param params  请求参数
 *  @param success 请求成功后的回调（请将请求成功后想做的事情写到这个block中）
 *  @param failure 请求失败后的回调（请将请求失败后想做的事情写到这个block中）
 */
+ (AFHTTPSessionManager *)get:(NSString *)url params:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;

+ (AFHTTPSessionManager *)post:(NSString *)url params:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;

+ (AFHTTPSessionManager *)post:(NSString *)url params:(NSDictionary *)params images:(NSArray*)images imagesName:(NSArray*)imagesName success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;

+ (AFHTTPSessionManager *)post:(NSString *)url params:(NSDictionary *)params imageParm:(NSString *)imagrParm images:(NSArray *)images imagesName:(NSArray*)imagesName success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;

+ (void)requestWithBaseUrl:(NSString *)baserUrl path:(NSString *)path method:(request_type)method isJSON:(BOOL)isJson params:(id)parm ssuccess:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;

@end
